Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

do not set both value and defaultValue on select #504

Merged
merged 2 commits into from
Mar 12, 2018

Conversation

nreese
Copy link
Contributor

@nreese nreese commented Mar 12, 2018

Warning: Select elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled select element and remove one of these props.

React throws the above if an Input element contains both value and defaultValue property.

This PR updates EuiSelect to ensure defaultValue is never set when value is provided.

Copy link
Contributor

@cjcenizal cjcenizal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! Thanks Nathan. Don't forget to add the PR link to the CHANGELOG.

@nreese nreese merged commit e6b0b22 into elastic:master Mar 12, 2018
@snide snide added the bug label Mar 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants